#include "Account.hh"
#include <sstream>

Account::Account(const std::string& number, double initialBalance)
    : accountNumber(number), balance(initialBalance) {}

void Account::deposit(double amount) {
    balance += amount;
}

bool Account::withdraw(double amount) {
    if (balance >= amount) {
        balance -= amount;
        return true;
    }
    return false;
}

std::string Account::getDetails() const {
    std::ostringstream oss;
    oss << accountNumber << " [" << getAccountType() << "] Balance: " << balance;
    return oss.str();
}

std::string Account::getAccountNumber() const {
    return accountNumber;
}

double Account::getBalance() const {
    return balance;
}

